<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
      <#assign base=request.contextPath  />
      <meta name="renderer" content="webkit">
      <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
      <title>企业充值</title>
      <#assign base=request.contextPath  />
      <link rel="stylesheet" href="${base}/frame/layui/css/layui.css">
      <link rel="stylesheet" href="${base}/frame/static/css/style.css">
      <link rel="icon" href="${base}/frame/static/image/code.png">
      <script type="text/javascript" src="${base}/frame/layui/layui.all.js"></script>
       <script type="text/javascript" src="${base}/js/zhang.js"></script>
       <script type="text/javascript" src="${base}/js/jquery.min.js"></script>
</head>
<body class="body">
<div class="ziyemianbiju">
	<div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
        <div class="my-btn-box">
            <span  id="layerDemo">
                <span class="layui-form-label">企业名称</span>
                <div class="layui-input-inline">
                    <input style="height: 31px;" class="layui-input" name="id" id="ptname" autocomplete="off">
                </div>
                	<button class="layui-btn layui-btn-sm layui-btn-normal" id="btn1" data-type="reload" style="background-color: #0092EF;">搜索</button>
               </span>
			<table class="layui-hide" id="test" lay-filter="test"></table>
			<script type="text/html" id="barDemo">
				  <a class="layui-btn layui-btn-primary layui-btn-xs" onclick="sbmint()"  lay-event="edit">企业充值</a>
				  <a class="layui-btn layui-btn-primary layui-btn-xs" onclick="Checksbmint()"  lay-event="edit1">企业退款</a>
			</script>
		</div>
	</div>
<script type="text/javascript">
layui.use(['layer','form','table'], function(){
  var form = layui.form;
  var table = layui.table;
  var layer = layui.layer;
  var $ = layui.jquery;
  table.render({
    even: true,//开启隔行背景
	size: 'xs',//小尺寸的表格
	elem: '#test',
    toolbar: '#toolbarDemo',
	url: '${base}/comMoneyInfo/list',
	title: '用户数据表',
    defaultToolbar: ['filter', 'print', 'exports'],
    cols: [[
        {field:'ptname', title: '企业名称',align:'center'}
      ,{field:'moeny', title: '企业余额',align:'center'}
        ,{field:'createTime', title: '时间',align:'center'}
        ,{field: 'right', title:'操作', toolbar: '#barDemo', align: 'center',width:250}
    ]]
    ,id: 'testReload'
      ,height:480
      ,page: {
          layout: ['limit', 'count', 'prev', 'page', 'next', 'skip']
          ,theme: '#9AC747'
          ,limit: 10
      }
  });
  $('#layerDemo .layui-btn').on('click', function(){
    var othis = $(this), method = othis.data('method');

  });
    // 分配资源
    table.on('tool(test)', function(obj){
      var data = obj.data;
      //console.log(obj)
     if(obj.event === 'edit'){
        layer.open({
          type: 2
          ,title: '企业充值'
          ,value: data.id
          ,content: '${base}/comMoneyInfo/assing.html',
                 success:function (layero, index){
                   var iframeWin = window[layero.find('iframe')[0]['name']];
                   iframeWin.$("#peopleId").val(data.id);
         }
        });
      }else if(obj.event === 'edit1'){
               layer.open({
                   type: 2
                   ,title: '企业退款'
                   ,content:  '${base}/comMoneyInfo/Recycle',
                      success:function (layero, index){
                                      var iframeWin = window[layero.find('iframe')[0]['name']];
                                      iframeWin.$("#peopleId").val(data.id);
                            }
                    });
                }
    });
    //查询
    $('#btn1').on('click', function(){
        var whereData={};
        whereData.ptname=Trim($("#ptname").val())
        var table = layui.table;
        //表刷新方法
        table.reload('testReload', {
            url: '${base}/comMoneyInfo/list'
            ,where: whereData
        });

    });
});



<#--//删除按钮-->
<#--function delectwork(id){-->
     <#--layer.confirm('真的要删除吗?', function(index){-->
                  <#--$.ajax({-->
                     <#--type:"POST",-->
                        <#--url:"${base}/xxxxx/xxxxxxxxxxxxx",-->
                        <#--data:{"id":id},-->
                            <#--success : function(data){-->
                            <#--var table = layui.table;-->
                             <#--//表刷新方法-->
                               <#--table.reload('testReload', {-->
                                    <#--url: '${base}/xxxx/xxxxxxxxxx'-->
                                       <#--,where: {} //设定异步数据接口的额外参数-->
                                                   <#--});-->
                                                     <#--layer.close(index);-->
                                        <#--}-->
                                  <#--});-->

                 <#--} );-->

<#--}-->

</script>

</body>
</html>